﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dye_Lib
{
    [Serializable]
    public class KlassenDiagramKlasse : Object
    {
        private string naam;

        public string Naam
        {
            get { return naam; }
            set { naam = value; }
        }

        private List<string> variabelen;
        private List<string> methoden;

        public KlassenDiagramKlasse(int posX, int posY, string naam = "", List<string> variabelen = null,
            List<string> methoden = null)
        {
            this.Naam = naam;
            if (variabelen == null)
                this.variabelen = new List<string>();
            else
                this.variabelen = variabelen;
            if (methoden == null)
                this.methoden = new List<string>();
            else
                this.methoden = methoden;

            // Hardcoded de size:
            afmeting = new Rectangle(posX, posY, 200, 90);
        }



        public override void Draw(Graphics g, int offsetX, int offsetY)
        {
            int margin = 4;
            Rectangle r = new Rectangle(afmeting.X + offsetX, afmeting.Y + offsetY, afmeting.Width, afmeting.Height);
            Rectangle rt = new Rectangle(afmeting.X + offsetX + margin, afmeting.Y + offsetY + margin,
                afmeting.Width - 2 * margin, 25);

            g.DrawRectangle((selected) ? Pens.Blue : Pens.Black, r);
            g.DrawLine((selected) ? Pens.Blue : Pens.Black, afmeting.X + offsetX, afmeting.Y + offsetY + 30,
                afmeting.X + offsetX + afmeting.Width, afmeting.Y + offsetY + 30); 
            g.DrawLine((selected) ? Pens.Blue : Pens.Black, afmeting.X + offsetX, afmeting.Y + offsetY + 60,
                 afmeting.X + offsetX + afmeting.Width, afmeting.Y + offsetY + 60);
            g.DrawString(Naam, new Font("Arial", 16), (selected) ? Brushes.Blue : Brushes.Black, rt);
        }
    }
}
